#ifndef BITS_H
#define BITS_H
namespace swfstream {
class Bits {
	uint offset;
	int bits_num;
	int nbytes;
	uint32 read_bits(int bits, FILE* f);
public:
	int32 read_s(int bits, FILE* f);
	uint32 read_u(int bits, FILE* f);
	byte n;
	Bits() {
		offset = 0;
		bits_num = 0;
		nbytes = 0;
	}
	int byte_num() {
		return nbytes;
	}
	void reset();
};
}

#endif
